<?php
/**
 * question
 *
 */
require_once 'lib/Service.php';
require_once 'models/QuestionModel.php';

class QuestionService extends Service{

	public function __construct(){
		parent::__construct();
		$this->_datakey = $this->_config['redisDatabase']['question'];
		$this->_model   = new QuestionModel();
	}
	/**
	 * 获取最新提问列表 
	 *
	 */
	 public function getRecentQuestions(){

		return $this->_model->getRecentQuestions();

	 }

	/**
	 * 获取用户提问列表 
	 *
	 */
	public function getQuestionsByUid( $uid ){
		return $this->_model->getQuestionsByUid( $uid );
	}

	/**
	 * 获取单个提问
	 */
	public function getQuestionById( $qid ){
		return $this->_model->getQuestionById( $qid );
	}

	/**
	 * insert
	 */
	public function create( $options ){
		return $this->_model->create( $options );
	}

}
